<!--
/**************************************************
* @(#)checkProvider.jsp
*
* Copyright (c) 2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/07/26, SimonyiPeng
*  1) first release
/**************************************************
-->

<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ page import="com.hitrust.gs.business.GSProviderProcessor"%>
<%@ page import="com.hitrust.gs.bean.GSProviderBean"%>
<%@ page import="java.net.*"%>
<%@ include file="../../common.jsp" %>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>


<%
boolean isManufactureExist = false;
GSProviderBean tBean = null;
try{
	String providerShortName = 	URLDecoder.decode(request.getParameter("providername"),"UTF-8");
System.out.println(providerShortName);
	GSProviderProcessor processor = new GSProviderProcessor ();
	tBean = processor.getProviderByShortName(providerShortName);
}
catch(Exception e){
	e.printStackTrace();
}
String providerid= "";
boolean bool = false;

if(tBean != null){

	providerid = tBean.getGs_provider_id();
	bool = true;
}
%>

<html>
<body onLoad="onsubmit();"></body>
<script language='javascript'>	
	function onsubmit(){

		if(<%=bool%>){
			parent.document.getElementById("providerid").value = '<%=providerid%>';
			alert("该供应商有效，按回车继续输入");

		}
		else{
			parent.document.getElementById("providerid").value = '';
			parent.document.getElementById("providername").value = '';
			alert("未查询到相关供应商，请重新查询或新增供应商");
		}

		return  false;
	}
</script>
</html>


